#include <gtk/gtk.h>
#include <string.h>

int main(int argc,char *argv[])
{
    GtkWidget *window;
    GtkWidget *vbox;
    GtkWidget *setButton;
    GtkWidget *accountsButton;
    GtkWidget *loansButton;
    GtkWidget *cashButton;
    GtkWidget *debtsButton;

    GdkColor  color_black_ = {0x0, 0xffff, 0xffff, 0xffff};

    gtk_init(&argc,&argv);

    /* create the main, top level, window */
    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title(GTK_WINDOW(window), TITLE);
    gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
    gtk_window_set_default_size(GTK_WINDOW(window), 250, 200);
    gtk_widget_modify_bg(window, GTK_STATE_NORMAL, &color_black_); /*设置为黑色背景*/

    /*fixed*/
    vbox = gtk_vbox_new(TRUE, 1);
    gtk_container_add(GTK_CONTAINER(window), vbox);

    /*buttons*/
    setButton = gtk_button_new_with_label("Settings");
    accountsButton = gtk_button_new_with_label("Accounts");
    loansButton = gtk_button_new_with_label("Loans");
    cashButton = gtk_button_new_with_label("Cash");
    debtsButton = gtk_button_new_with_label("Debts");

    gtk_box_pack_start(GTK_BOX(vbox), setButton, TRUE, TRUE, 0);
    gtk_box_pack_start(GTK_BOX(vbox), accountsButton, TRUE, TRUE, 0);
    gtk_box_pack_start(GTK_BOX(vbox), loansButton, TRUE, TRUE, 0);
    gtk_box_pack_start(GTK_BOX(vbox), cashButton, TRUE, TRUE, 0);
    gtk_box_pack_start(GTK_BOX(vbox), debtsButton, TRUE, TRUE, 0);

    g_signal_connect_swapped(G_OBJECT(window),"destroy",G_CALLBACK(gtk_main_quit),NULL);


    /* make sure that everything, window and label, are visible */
    gtk_widget_show_all(window);

    /* start the main loop, and let it rest until the application is closed */
    gtk_main();

    return 0;
}
